package collection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

public class ArrayToListDemo {
    public static void main(String[] args) {
        /** Arrays.asList(数组引用)
         * 数组转集合的方法
         * */
        String[]arr={"1","2","3","4"};
        List<String> strings = Arrays.asList(arr);


        System.out.println(strings);




        /**set(从第几个元素,替换的内容)
         * 集合替换元素
         * */
        strings.set(2,"three");
        Collection<String> cc=new ArrayList<>();
        cc.addAll(strings);

        cc.add("78979456489");



        System.out.println(cc);

        System.out.println(strings);

    }
}
